﻿using SheBao.IDAL;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace SheBao.DALFactory
{
    public class DalFactory
    {
        public static readonly string AssemblyName;

        /// <summary>
        /// 静态构造方法仅仅只执行一次 
        /// </summary>
        static DalFactory()
        {
            AssemblyName = ConfigurationManager.AppSettings["AssemblyName"];

        }
        public static IUserDal GetUserDal()
        {
            var obj = Assembly.Load(AssemblyName).CreateInstance(AssemblyName + ".UserDal", true);
            return obj as IUserDal;

        }
    }
}
